import type { Component } from 'vue'
import type {
  EnergyType,
  EnterpriseMonthReportQueryAllListParams,
} from '@/types'
import { PAGING } from '@/constant'

export interface ComType {
  type: EnergyType
  render: () => Component
}

export const defaultFormData: any = {
  name: '',
}

export const formRules = {
  name: [
    {
      required: true,
      message: '名称不能为空！',
      trigger: 'change',
    },
  ],
}

export const defaultPagingParams: Partial<EnterpriseMonthReportQueryAllListParams>
  = {
    ...PAGING.PARAMS,
    tenantName: '',
    formName: '',
    dataTime: '',
  }

export const comObj: Partial<Record<EnergyType, ComType>>
  = {
    electric: {
      type: 'electric',
      render: () =>
        componentLoadAsync(
          () =>
            import(
              '../EnergyConsumptionReport/components/electricity-report.vue'
            ),
        ),
    },
  }
